<template>
    <div>
        <h2>学生姓名：{{name}}</h2>
        <h2>学生年龄：{{age+5}}</h2>
        <button @click="sendStuName">点我发给school数据</button>
    </div>
</template>

<script>
export default {
    name:'Student',
    data() {
        return {
            name:'张三',
            age:18
        }
    },
    methods:{
        sendStuName(){
            this.$bus.$emit('hi',this.name)
        },
       
    }
}
</script>
<style scoped>
/* scoped 定义局部样式 */
    div{
        background-color: red;
    }
</style>